package ua.kpi.oblamskyiv.factory;

import ua.kpi.oblamskyiv.parser.QuestionsParser;
import ua.kpi.oblamskyiv.testcase.Questions;

/**
 * Abstract factory implementation, where questions are parsed from string
 */
public class FileStringQuestionsFactory implements QuestionsFactory {
    private String questionsString;

    public FileStringQuestionsFactory(String questionsString) {
        this.questionsString = questionsString;
    }

    @Override
    public Questions createQuestions() {
        QuestionsParser parser = new QuestionsParser(questionsString);
        return parser.parseQuestions();
    }
}
